<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib
        uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="">
    <%-- <base href="<%=basePath%>"> --%>
    <title>备品配件验收指令明细详情</title>
    <link rel="stylesheet"
          href="<%=basePath%>resourse/weui/lib/weui.min.css">
    <link rel="stylesheet"
          href="<%=basePath%>resourse/weui/css/jquery-weui.min.css">
    <script src="<%=basePath%>resourse/weui/lib/jquery-2.1.4.js"></script>
    <script src="<%=basePath%>resourse/weui/js/jquery-weui.min.js"></script>
    <!-- 如果使用了某些拓展插件还需要额外的JS -->
    <script src="<%=basePath%>resourse/weui/js/swiper.min.js"></script>
    <script src="<%=basePath%>resourse/weui/js/city-picker.min.js"></script>
    <script src="<%=basePath%>resourse/weui/lib/fastclick.js"></script>
</head>
<style>
    .form-value {
        margin-left: 30px;
    }

    .weui-label {
        display: block;
        width: 120px;
        word-wrap: break-word;
        word-break: break-all;
    }
    * {
        touch-action: pan-y;
    }
</style>
<script>
    $(function () {
        /**
         * 初始化各下拉框的备选项
         */
            // 设置检验特性结果下拉
        const resultOptions = getResultOptions('result')
        $("#deaResult").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaResultCode').val(values.data.values)
                $('#deaResultText').val(values.data.titles)
            }
        });

        $("#deaResult").select("update", {items: resultOptions});

        $("#parResultStatus").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parResultStatusCode').val(values.data.values)
                $('#parResultStatusText').val(values.data.titles)
            }
        });
        $("#parResultStatus").select("update", {items: resultOptions});


        // 设置使用决策代码组下拉
        $("#parUseCodeGroup").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parUseCodeGroupCode').val(values.data.values)
            }
        });
        const useCodeGroupOptions = getResultOptions('useCodeGroup')
        $("#parUseCodeGroup").select("update", {items: useCodeGroupOptions});

        $("#deaUseDecisionGroup").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaUserDecisionGroupCode').val(values.data.values)
            }
        });
        $("#deaUserDecisionGroup").select("update", {items: useCodeGroupOptions});


        // 设置使用决策代码下拉
        $("#deaUse").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaUseCode').val(values.data.values)
                $('#deaUseText').val(values.data.titles)
            }
        });
        const useOptions = getResultOptions('use')
        $("#deaUse").select("update", {items: useOptions});

        $("#parUseCode").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parUseCodeTemp').val(values.data.values)
                $('#parUseText').val(values.data.titles)
            }
        });
        $("#parUseCode").select("update", {items: useOptions});


        // 设置缺陷位置代码组下拉
        $("#deaBugAddressCodeGroup").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaBugAddressCodeGroupTemp').val(values.data.values)
                $('#deaBugAddressCodeGroupText').val(values.data.titles)
            }
        });
        const bugAddressCodeGroupOptions = getResultOptions('bugAddressCodeGroup')
        $("#deaBugAddressCodeGroup").select("update", {items: bugAddressCodeGroupOptions});

        $("#parBugAddressCodeGroup").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parBugAddressCodeGroupTemp').val(values.data.values)
                $('#parBugAddressCodeGroupText').val(values.data.titles)
            }
        });
        $("#parBugAddressCodeGroup").select("update", {items: bugAddressCodeGroupOptions});

        /* $("#procBugAddressGroup").select({
             title: "请选择",
             items: [],
             onClose: function (values) {
                 $('#procBugAddressGroupTemp').val(values.data.values)
                 $('#procBugAddressGroupText').val(values.data.titles)
             }
         });
         $("#procBugAddressGroup").select("update", {items: bugAddressCodeGroupOptions});*/


        // 设置缺陷位置下拉
        $("#deaBugAddress").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaBugAddressCode').val(values.data.values)
                $('#deaBugAddressText').val(values.data.titles)
            }
        });
        const bugAddressOptions = getResultOptions('bugAddress')
        $("#deaBugAddress").select("update", {items: bugAddressOptions});

        $("#parBugAddressCode").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parBugAddressCodeTemp').val(values.data.values)
                $('#parBugAddressText').val(values.data.titles)
            }
        });
        $("#parBugAddressCode").select("update", {items: bugAddressOptions});
        /*$("#procBugAddressCode").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#procBugAddressCodeTemp').val(values.data.values)
                $('#procBugAddressCodeText').val(values.data.titles)
            }
        });
        $("#procBugAddressCode").select("update", {items: bugAddressOptions});*/


        // 设置缺陷类下拉
        $("#deaBugClass").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaBugClassCode').val(values.data.values)
                $('#deaBugClassText').val(values.data.titles)
            }
        });
        const bugClassOptions = getResultOptions('bugClass')
        $("#deaBugClass").select("update", {items: bugClassOptions});

        $("#parBugClass").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parBugClassCodeTemp').val(values.data.values)
                $('#parBugClassText').val(values.data.titles)
            }
        });
        $("#parBugClass").select("update", {items: bugClassOptions});

        /*$("#procBugClassCode").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#procBugClassCodeTemp').val(values.data.values)
                $('#procBugClassText').val(values.data.titles)
            }
        });
        $("#procBugClassCode").select("update", {items: bugClassOptions});*/


        // 设置缺陷类型下拉
        $("#deaBugType").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaBugTypeTemp').val(values.data.values)
                $('#deaBugTypeText').val(values.data.titles)
            }
        });
        const bugTypeOptions = getResultOptions('bugType')
        $("#deaBugType").select("update", {items: bugTypeOptions});

        $("#parBugType").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parBugTypeCodeTemp').val(values.data.values)
                $('#parBugTypeText').val(values.data.titles)
            }
        });
        $("#parBugType").select("update", {items: bugTypeOptions});

        /* $("#procBugTypeCode").select({
             title: "请选择",
             items: [],
             onClose: function (values) {
                 $('#procBugTypeCodeTemp').val(values.data.values)
                 $('#procBugTypeText').val(values.data.titles)
             }
         });
         $("#procBugTypeCode").select("update", {items: bugTypeOptions});*/


        // 设置缺陷类型代码组
        $("#deaBugTypeCodeGroup").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#deaBugTypeCodeGroupTemp').val(values.data.values)
                $('#deaBugTypeCodeGroupText').val(values.data.titles)
            }
        });
        const bugTypeCodeGroupOptions = getResultOptions('bugTypeCodeGroup')
        $("#deaBugTypeCodeGroup").select("update", {items: bugTypeCodeGroupOptions});

        $("#parBugTypeCodeGroup").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parBugTypeCodeGroupCodeTemp').val(values.data.values)
                $('#parBugTypeCodeGroupText').val(values.data.titles)
            }
        });
        $("#parBugTypeCodeGroup").select("update", {items: bugTypeCodeGroupOptions});

        /* $("#procBugTypeGroup").select({
             title: "请选择",
             items: [],
             onClose: function (values) {
                 $('#procBugTypeGroupCodeTemp').val(values.data.values)
                 $('#procBugTypeGroupText').val(values.data.titles)
             }
         });
         $("#procBugTypeGroup").select("update", {items: bugTypeCodeGroupOptions});*/


        // 设置评估下拉
        $("#dreaAssessType").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#dreaAssessTypeCode').val(values.data.values)
                $('#dreaAssessTypeText').val(values.data.titles)
            }
        });
        const assessTypeOptions = getResultOptions('assessType')
        $("#dreaAssessType").select("update", {items: assessTypeOptions});

        $("#parAssessType").select({
            title: "请选择",
            items: [],
            onClose: function (values) {
                $('#parAssessTypeCodeTemp').val(values.data.values)
                $('#parAssessTypeText').val(values.data.titles)
            }
        });
        $("#parAssessType").select("update", {items: assessTypeOptions});
        /**
         * 设置时间选择框
         */
        let parPracticalChenkStartDateTem = '${partsModel.parPracticalChenkStartDate}'
        $("#parPracticalChenkStartDate").datetimePicker({
            value: parPracticalChenkStartDateTem,
            onChange: function (result) {
                var dateValues = result.value
                var dateStr = dateValues[0] + '-' + dateValues[1] + '-' + dateValues[2] + ' ' + dateValues[3] + ':' + dateValues[4]
                $('#parPracticalCheckStartDateTemp').val(dateStr);
            }
        });
        let parPracticalChenkEndDateTem = '${partsModel.parPracticalChenkEndDate}'
        $("#parPracticalChenkEndDate").datetimePicker({
            value: parPracticalChenkEndDateTem,
            onChange: function (result) {
                var dateValues = result.value
                var dateStr = dateValues[0] + '-' + dateValues[1] + '-' + dateValues[2] + ' ' + dateValues[3] + ':' + dateValues[4]
                $('#parPracticalCheckEndDateTemp').val(dateStr);
                //   $('#parPracticalCheckEndDateTemp').val(dateValues.join('-'));
            }
        });
        // 工序的时间选择框
        $("#procCheckStartDate").datetimePicker({
            onChange: function (picker, result, displayValues) {
                var dateValues = result.value
                var dateStr = dateValues[0] + '-' + dateValues[1] + '-' + dateValues[2] + ' ' + dateValues[3] + ':' + dateValues[4]
                $('#procPracticalCheckStartDateTemp').val(dateStr);
            }
        });
        $("#procCheckEndDate").datetimePicker({
            onChange: function (result) {
                var dateValues = result.value
                var dateStr = dateValues[0] + '-' + dateValues[1] + '-' + dateValues[2] + ' ' + dateValues[3] + ':' + dateValues[4]
                $('#procPracticalCheckEndDateTemp').val(dateStr);
            }
        });

        /**
         * 页面加载时，初始化model的下拉值
         */
        let parBugAddressCodeGroup = '${partsModel.parBugAddressCodeGroup}'
        let parBugAddressGroupText = '${partsModel.parBugAddressGroupText}'
        // 缺陷位置代码组
        $('#parBugAddressCodeGroup').val(parBugAddressGroupText);
        $('#parBugAddressCodeGroup').attr("data-values", parBugAddressCodeGroup);
        // 缺陷位置
        let parBugAddressCode = '${partsModel.parBugAddressCode}'
        let parBugAddressText = '${partsModel.parBugAddressText}'
        $('#parBugAddressCode').val(parBugAddressText);
        $('#parBugAddressCode').attr("data-values", parBugAddressCode);
        // 缺陷类
        let parBugClassCode = '${partsModel.parBugClassCode}'
        let parBugClassText = '${partsModel.parBugClassText}'
        $('#parBugClass').val(parBugClassText);
        $('#parBugClass').attr("data-values", parBugClassCode);
        // 缺陷类型代码组
        let parBugTypeCodeGroup = '${partsModel.parBugTypeCodeGroup}'
        let parBugTypeCodeGroupText = '${partsModel.parBugTypeCodeGroupText}'
        $('#parBugTypeCodeGroup').val(parBugTypeCodeGroupText);
        $('#parBugTypeCodeGroup').attr("data-values", parBugTypeCodeGroup);
        // 缺陷类型代码
        let parBugTypeCode = '${partsModel.parBugTypeCode}'
        let parBugTypeText = '${partsModel.parBugTypeText}'
        $('#parBugType').val(parBugTypeText);
        $('#parBugType').attr("data-values", parBugTypeCode);
        // 结果属性
        let resultCode = '${partDetail.resultCode}'
        let resultText = '${partDetail.resultText}'
        $('#deaResult').val(resultText);
        $('#deaResult').attr("data-values", resultCode);
        // 评估
        let assessCode = '${partDetail.assessCode}'
        let assessText = '${partDetail.assessText}'
        $('#dreaAssessType').val(assessText);
        $('#dreaAssessType').attr("data-values", assessCode);


    })


</script>
<body ontouchstart>
<div class="weui-tab">
    <%--<div class="weui-navbar">
        <a class="weui-navbar__item weui-bar__item--on"> 备品配件验收指令明细</a>
    </div>--%>
    <div class="weui-tab__bd">
        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
            <%-- 指令单抬头 --%>
            <div class="weui-cells weui-cells_form">
                <div class="weui-cells__title">检验批信息</div>
                <%-- parId --%>
                <input type="hidden" value="${partsModel.parId}" id="parId">
                <%-- 接口id --%>
                <input type="hidden" value="${partsModel.interfaceId}" id="interfaceId">
                <%--                工厂CODE--%>
                <input type="hidden" value="${partsModel.parFactory}" id="parFactory">
                <input type="hidden" id="procId" value="${processModel.procId}">
                <%--  <div class="weui-cell">

                    <div class="weui-cell__hd"><label class="weui-label">工厂：</label></div>
                     <div class="weui-cell__bd">

                         <input id="parFactoryDetail" class="weui-input form-value" type="text"
                                value="${partsModel.parFactoryDetail}">
                     </div>

                </div>--%>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验批号编号：</label></div>
                    <div class="weui-cell__bd">

                        <input class="weui-input form-value" id="parCheckCode" type="text"
                               value="${partsModel.parCheckCode}">
                    </div>
                </div>
                <%--<div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验批来源：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parCheckSourse" type="text"
                               value="${partsModel.parCheckSourse}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验类型：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parCheckType" type="text"
                               value="${partsModel.parCheckType}">
                    </div>
                </div>--%>
                <%-- <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">物料编号：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="mmCode" type="text" value="${partsModel.mmCode}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">物料描述：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="mmDetail" type="text" value="${partsModel.mmDetail}">
                    </div>
                </div>
               <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">批次编号：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parCode" type="text" value="${partsModel.parCode}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">存储地点：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parAddress" type="text"
                               value="${partsModel.parAddress}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">组：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parGroup" type="text" value="${partsModel.parGroup}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">组计数器：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parGroupNum" type="text"
                               value="${partsModel.parGroupNum}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验开始日期：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parCheckStartDate" type="text"
                               value="${partsModel.parCheckStartDate}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验结束日期：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parCheckEndDate" type="text"
                               value="${partsModel.parCheckEndDate}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">用途：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parUse" type="text" value="${partsModel.parUse}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验批数量：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parCheckNum" type="text"
                               value="${partsModel.parCheckNum}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">供应商：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parSupplyCode" type="text"
                               value="${partsModel.parSupplyCode}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">供应商名称：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parSupplyName" type="text"
                               value="${partsModel.parSupplyName}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">采购凭证：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parProof" type="text" value="${partsModel.parProof}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">采购凭证的项目编号：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="parProjectNum" type="text"
                               value="${partsModel.parProjectNum}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">物料凭证：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="mmProof" type="text" value="${partsModel.mmProof}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">物料凭证中的项目：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="mmProofProject" type="text"
                               value="${partsModel.mmProofProject}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">创建人姓名：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="createName" type="text"
                               value="${partsModel.createName}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">创建时间：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="createTime" type="text"
                               value="${partsModel.createTime}">
                    </div>
                </div>--%>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验员：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" type="text" id='parInspector' value="${partsModel.parInspector}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">实际检验开始时间：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="parPracticalCheckStartDateTemp"
                               value="${partsModel.parPracticalChenkStartDate}">
                        <input class="weui-input form-value" type="text" id='parPracticalChenkStartDate'
                               placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">实际检验结束时间：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="parPracticalCheckEndDateTemp"
                               value="${partsModel.parPracticalChenkEndDate}">
                        <input class="weui-input form-value" type="text" id='parPracticalChenkEndDate'
                               placeholder="请选择">
                    </div>
                </div>
                <%--  <div class="weui-cell">
                     <div class="weui-cell__hd"><label class="weui-label">评估：</label></div>
                     <div class="weui-cell__bd">
                         <input type="hidden" id="parAssessTypeCodeTemp">
                         <input type="hidden" id="parAssessTypeText">
                         <input class="weui-input form-value" type="text" id='parAssessType' placeholder="请选择">
                     </div>
                 </div>
                <div class="weui-cell">
                     <div class="weui-cell__hd"><label class="weui-label">检验特性的结果属性：</label></div>
                     <div class="weui-cell__bd">
                         <input type="hidden" id="parResultStatusCode">
                         <input type="hidden" id="parResultStatusText">
                         <input class="weui-input form-value" type="text" id='parResultStatus' placeholder="请选择">
                     </div>
                 </div>--%>
                <%-- <div class="weui-cell">
                     <div class="weui-cell__hd"><label class="weui-label">使用决策代码组：</label></div>
                     <div class="weui-cell__bd">
                         <input type="hidden" id="parUseCodeGroupCode" value="${partsModel.parUseCodeGroup}">
                         <input class="weui-input form-value" type="text" id='parUseCodeGroup' placeholder="请选择">
                     </div>
                 </div>
                 <div class="weui-cell">
                     <div class="weui-cell__hd"><label class="weui-label">使用决策代码：</label></div>
                     <div class="weui-cell__bd">
                         <input type="hidden" id="parUseCodeTemp" value="${partsModel.parUseCode}">
                         <input type="hidden" id="parUseText" value="${partsModel.parUseText}">
                         <input class="weui-input form-value" type="text" id='parUseCode' placeholder="请选择">
                     </div>
                 </div>--%>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷位置代码组：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="parBugAddressCodeGroupTemp"
                               value="${partsModel.parBugAddressCodeGroup}">
                        <input type="hidden" id="parBugAddressCodeGroupText"
                               value="${partsModel.parBugAddressGroupText}">
                        <input class="weui-input form-value" type="text" id='parBugAddressCodeGroup' placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷位置：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="parBugAddressCodeTemp" value="${partsModel.parBugAddressCode}">
                        <input type="hidden" id="parBugAddressText" value="${partsModel.parBugAddressText}">
                        <input class="weui-input form-value" type="text" id='parBugAddressCode' placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷类：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="parBugClassCodeTemp" value="${partsModel.parBugClassCode}">
                        <input type="hidden" id="parBugClassText" value="${partsModel.parBugClassText}">
                        <input class="weui-input form-value" type="text" id='parBugClass' placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷类型代码组：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="parBugTypeCodeGroupCodeTemp" value="${partsModel.parBugTypeCodeGroup}">
                        <input type="hidden" id="parBugTypeCodeGroupText" value="${partsModel.parBugTypeCodeGroupText}">
                        <input class="weui-input form-value" type="text" id='parBugTypeCodeGroup' placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷类型：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="parBugTypeCodeTemp" value="${partsModel.parBugTypeCode}">
                        <input type="hidden" id="parBugTypeText" value="${partsModel.parBugTypeText}">
                        <input class="weui-input form-value" type="text" id='parBugType' placeholder="请选择">
                    </div>
                </div>

            </div>
            <%-- 工序信息--%>
            <%--<div class="weui-cells weui-cells_form">
                <div class="weui-cells__title">工序信息</div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">工序编号：</label></div>
                    <div class="weui-cell__bd">

                        <input class="weui-input form-value" id="procNum" type="text" value="${processModel.procNum}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">工序描述：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="procText" type="text" value="${processModel.procText}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验员：</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input form-value" id="procInspector" type="text"
                               value="${processModel.procInspector}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验开始日期：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="procPracticalCheckStartDateTemp">
                        <input class="weui-input form-value" id="procCheckStartDate" type="text"
                               value="${processModel.procCheckStartDate}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">检验结束日期：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="procPracticalCheckEndDateTemp">
                        <input class="weui-input form-value" id="procCheckEndDate" type="text"
                               value="${processModel.procCheckEndDate}">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷类：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="procBugClassCodeTemp">
                        <input type="hidden" id="procBugClassText">
                        <input class="weui-input form-value" type="text" id='procBugClassCode' placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷类型代码组：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="procBugTypeGroupCodeTemp">
                        <input type="hidden" id="procBugTypeGroupText">
                        <input class="weui-input form-value" type="text" id="procBugTypeGroup" placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷类型：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="procBugTypeCodeTemp">
                        <input type="hidden" id="procBugTypeText">
                        <input class="weui-input form-value" type="text" id="procBugTypeCode" placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷位置代码组：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="procBugAddressGroupTemp">
                        <input type="hidden" id="procBugAddressGroupText">
                        <input class="weui-input form-value" type="text" id="procBugAddressGroup" placeholder="请选择">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">缺陷位置代码：</label></div>
                    <div class="weui-cell__bd">
                        <input type="hidden" id="procBugAddressCodeTemp">
                        <input type="hidden" id="procBugAddressCodeText">
                        <input class="weui-input form-value" type="text" id="procBugAddressCode" placeholder="请选择">
                    </div>
                </div>
            </div>--%>
        </div>
        <%--            指令单明细详情--%>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cells__title">检验特性信息</div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">定量/定性特性：</label></div>
                <div class="weui-cell__bd">
                    <%-- parId --%>
                    <input type="hidden" value="${partDetail.parId}" id="parId">
                    <%-- deaId --%>
                    <input type="hidden" value="${partDetail.deaId}" id="deaId">
                    <%--                工厂CODE--%>
                    <input type="hidden" value="${partDetail.deaPerform}" id="deaPerform">
                    <input class="weui-input form-value" type="text" value="${partDetail.deaPerform}">
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">状态：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" id="" type="text" value="${partDetail.status==1?'已提交':'未提交'}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">主检验特征编号：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" id="deaMainCode" type="text" value="${partDetail.deaMainCode}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">主检验特征：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaMain" value="${partDetail.deaMain}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">检验特性的短文本：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaTxt" value="${partDetail.deaTxt}">
                </div>
            </div>
            <%-- <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">规范下限：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaLower" value="${partDetail.deaLower}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">规范上限：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaUp" value="${partDetail.deaUp}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">检查目标值：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaTarget" value="${partDetail.deaTarget}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">采样过程：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaSamping" value="${partDetail.deaSamping}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">记录缺陷数：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaBugNum" value="${partDetail.deaBugNum}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">总计结果：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaTotal" value="${partDetail.deaTotal}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">单个结果：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaSingle" value="${partDetail.deaSingle}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">单位分组：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaGroup" value="${partDetail.deaGroup}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">小数位：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaDecimal" value="${partDetail.deaDecimal}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">测量单位：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaMeasure" value="${partDetail.deaMeasure}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">目标值：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaObject" value="${partDetail.deaObject}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">实际上限：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaRealUp" value="${partDetail.deaRealUp}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">实际下限：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaRealLower"
                            value="${partDetail.deaRealLower}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">检验方法编号：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaMethodCode"
                            value="${partDetail.deaMethodCode}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">检验方法描述：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaMethodText"
                            value="${partDetail.deaMethodText}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">检验方法工厂：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaFactory" value="${partDetail.deaFactory}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">检验方法版本：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaVersion" value="${partDetail.deaVersion}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">采样过程编号：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaProcedureCode"
                            value="${partDetail.deaProcedureCode}">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">采样过程编号描述：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaProcedureDetail"
                            value="${partDetail.deaProcedureDetail}">
                 </div>
             </div>--%>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">采样计量单位：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaUnit" value="${partDetail.deaUnit}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">检验描述：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="checkDescr" value="${partDetail.checkDescr}">
                </div>
            </div>
            <%-- <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">基本采样数量：</label></div>
                 <div class="weui-cell__bd">
                     <input class="weui-input form-value" type="text" id="deaBasisNum" value="${partDetail.deaBasisNum}">
                 </div>
             </div>--%>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">采样大小：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaSamplingSize"
                           value="${partDetail.deaSamplingSize}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">已检验：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="inspected"
                           value="${partDetail.inspected}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">不合格：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="disqualification"
                           value="${partDetail.disqualification}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">缺陷数：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="flawNum"
                           value="${partDetail.flawNum}">
                </div>
            </div>
            <%--  <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">采样确定规则的标识：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaRuleTag" value="${partDetail.deaRuleTag}">
                </div>
            </div>
          <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">客户批次号：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaClientBatch"
                           value="${partDetail.deaClientBatch}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">分配的代码组或选择集：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaCodeGroup"
                           value="${partDetail.deaCodeGroup}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">选择集的简要描述：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaCodeText" value="${partDetail.deaCodeText}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">分配的选择集工厂：</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input form-value" type="text" id="deaSelectFactory"
                           value="${partDetail.deaSelectFactory}">
                </div>
            </div>--%>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">检验特性的结果属性：</label></div>
                <div class="weui-cell__bd">
                    <input type="hidden" id="deaResultCode" value="${partDetail.resultCode}">
                    <input type="hidden" id="deaResultText" value="${partDetail.resultText}">
                    <input class="weui-input form-value" type="text" id='deaResult' placeholder="请选择">
                </div>
            </div>
            <%-- <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">使用决策代码组：</label></div>
                 <div class="weui-cell__bd">
                     <input type="hidden" id="deaUserDecisionGroupCode">
                     <input class="weui-input form-value" type="text" id='deaUserDecisionGroup' placeholder="请选择">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">使用决策代码：</label></div>
                 <div class="weui-cell__bd">
                     <input type="hidden" id="deaUseCode">
                     <input type="hidden" id="deaUseText">
                     <input class="weui-input form-value" type="text" id='deaUse' placeholder="请选择">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">缺陷位置代码组：</label></div>
                 <div class="weui-cell__bd">
                     <input type="hidden" id="deaBugAddressCodeGroupTemp">
                     <input type="hidden" id="deaBugAddressCodeGroupText">
                     <input class="weui-input form-value" type="text" id='deaBugAddressCodeGroup' placeholder="请选择">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">缺陷位置：</label></div>
                 <div class="weui-cell__bd">
                     <input type="hidden" id="deaBugAddressCode">
                     <input type="hidden" id="deaBugAddressText">
                     <input class="weui-input form-value" type="text" id='deaBugAddress' placeholder="请选择">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">缺陷类：</label></div>
                 <div class="weui-cell__bd">
                     <input type="hidden" id="deaBugClassCode">
                     <input type="hidden" id="deaBugClassText">
                     <input class="weui-input form-value" type="text" id='deaBugClass' placeholder="请选择">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">缺陷类型代码组：</label></div>
                 <div class="weui-cell__bd">
                     <input type="hidden" id="deaBugTypeCodeGroupTemp">
                     <input type="hidden" id="deaBugTypeCodeGroupText">
                     <input class="weui-input form-value" type="text" id='deaBugTypeCodeGroup' placeholder="请选择">
                 </div>
             </div>
             <div class="weui-cell">
                 <div class="weui-cell__hd"><label class="weui-label">缺陷类型：</label></div>
                 <div class="weui-cell__bd">
                     <input type="hidden" id="deaBugTypeTemp">
                     <input type="hidden" id="deaBugTypeText">
                     <input class="weui-input form-value" type="text" id='deaBugType' placeholder="请选择">
                 </div>
             </div>--%>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">评估：</label></div>
                <div class="weui-cell__bd">
                    <input type="hidden" id="dreaAssessTypeCode" value="${partDetail.assessCode}">
                    <input type="hidden" id="dreaAssessTypeText" value="${partDetail.assessText}">
                    <input class="weui-input form-value" type="text" id='dreaAssessType' placeholder="请选择">
                </div>
            </div>

        </div>
    </div>
</div>
</div>
<c:if test="${partsModel.status !='1'}">
    <a href="javascript:;" style="width: 96%;margin: 10px auto" id="save" class="weui-btn weui-btn_primary">保存</a>
</c:if>
</body>
<script>
    //
    function getResultOptions(type) {
        let optionsTem = []
        $.ajax({
            type: "get",
            url: "api/qm/parts/getPartsOptions?type=" + type,
            dataType: "json",
            async: false,
            headers: {
                token: localStorage.getItem("token")
            },
            success: function (data) {
                if (data.code == 60200) {
                    optionsTem = data.data
                } else {
                    $.toptip('获取配置项失败', 'error');
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(errorThrown);
            }
        });
        // 在第一行加入一个空值对象，用来取消选中
        optionsTem.unshift({
            "data-values": "",
            "title": "--",
            "type": type,
            "value": ""
        })
        return optionsTem
    }

    // 下一步按钮的点击事件
    $('#save').click(function () {
        save('save');
    })

    /**
     * 表单保存
     */
    function save(action) {
        var status = '0'
        /**
         * 字段校验
         */
        /* var useCodeGroup_valid = $('#parUseCodeGroupCode').val()
         if (!useCodeGroup_valid) {
             $.toptip('检验批的使用决策代码组不得为空', 2000, 'error');
             return
         }
         var useCode_valid = $('#parUseCodeTemp').val()
         if (!useCode_valid) {
             $.toptip('检验批的使用决策代码不得为空', 2000, 'error');
             return
         }
         var deaAssess_valid = $('#dreaAssessTypeCode').val()
         if (!deaAssess_valid) {
             $.toptip('检验特性的评估不得为空，请选择', 2000, 'error');
             return
         }*/
        var processes = []
        var partsDetailModels = []


        // 检验批
        var part = {
            parId: $('#parId').val(),
            interfaceId: $('#interfaceId').val(),
            parFactory: $('#parFactory').val(),
            parFactoryDetail: $('#parFactoryDetail').val(),
            parCheckCode: $('#parCheckCode').val(),
            parCheckSourse: $('#parCheckSourse').val(),
            parCheckType: $('#parCheckType').val(),
            mmCode: $('#mmCode').val(),
            parCode: $('#parCode').val(),
            parAddress: $('#parAddress').val(),
            parGroup: $('#parGroup').val(),
            parGroupNum: $('#parGroupNum').val(),
            mmDetail: $('#mmDetail').val(),
            parCheckStartDate: $('#parCheckStartDate').val(),
            parCheckEndDate: $('#parCheckEndDate').val(),
            parUse: $('#parUse').val(),
            parCheckNum: $('#parCheckNum').val(),
            parSupplyCode: $('#parSupplyCode').val(),
            parSupplyName: $('#parSupplyName').val(),
            parProof: $('#parProof').val(),
            parProjectNum: $('#parProjectNum').val(),
            mmProof: $('#mmProof').val(),
            mmProofProject: $('#mmProofProject').val(),
            status: '0',
            parDeliveryOrder: $('#parDeliveryOrder').val(),
            parDeliveryOrderNum: $('#parDeliveryOrderNum').val(),
            carNum: $('#carNum').val(),
            parPoundsNum: $('#parPoundsNum').val(),
            parInspector: $('#parInspector').val(),
            parPracticalChenkStartDate: $('#parPracticalCheckStartDateTemp').val(),
            parPracticalChenkEndDate: $('#parPracticalCheckEndDateTemp').val(),
            parResultStatus: $('#parResultStatusCode').val(),
            parResultStatusText: $('#parResultStatusText').val(),
            parUseCode: $('#parUseCodeTemp').val(),
            parUseText: $('#parUseText').val(),
            parUseCodeGroup: $('#parUseCodeGroupCode').val(),
            parBugTypeCodeGroup: $('#parBugTypeCodeGroupCodeTemp').val(),
            parBugTypeCodeGroupText: $('#parBugTypeCodeGroupText').val(),
            parBugTypeCode: $('#parBugTypeCodeTemp').val(),
            parBugTypeText: $('#parBugTypeText').val(),
            parBugAddressCode: $('#parBugAddressCodeTemp').val(),
            parBugAddressText: $('#parBugAddressText').val(),
            parBugAddressCodeGroup: $('#parBugAddressCodeGroupTemp').val(),
            parBugAddressGroupText: $('#parBugAddressCodeGroupText').val(),
            parBugClassCode: $('#parBugClassCodeTemp').val(),
            parBugClassText: $('#parBugClassText').val(),
            processes: processes

        }
        // 工序
        var process = {
            /* procId: $('#procId').val(),
             parId: $('#parId').val(),
             procText: $('#procText').val(),
             procNum: $('#procNum').val(),
             procInspector: $('#procInspector').val(),
             procCheckStartDate: $('#procPracticalCheckStartDateTemp').val(),
             procCheckEndDate: $('#procPracticalCheckEndDateTemp').val(),
             procBugClassCode: $('#procBugClassCodeTemp').val(),
             procBugClassText: $('#procBugClassText').val(),
             procBugTypeCode: $('#procBugTypeCodeTemp').val(),
             procBugTypeText: $('#procBugTypeText').val(),
             procBugTypeGroup: $('#procBugTypeGroupCodeTemp').val(),
             procBugTypeGroupText: $('#procBugTypeGroupText').val(),
             procBugAddressCode: $('#procBugAddressCodeTemp').val(),
             procBugAddressText: $('#procBugAddressCodeText').val(),
             procBugAddressGroup: $('#procBugAddressGroupTemp').val(),
             procBugAddressGroupText: $('#procBugAddressGroupText').val(),*/
            partsDetailModels: partsDetailModels
        }
        // 指令单详情
        var partDeatil = {
            deaId: $('#deaId').val(),
            procId: $('#procId').val(),
            parId: $('#parId').val(),
            deaPerform: $('#deaPerform').val(),
            deaMainCode: $('#deaMainCode').val(),
            deaMain: $('#deaMain').val(),
            deaTxt: $('#deaTxt').val(),
            deaLower: $('#deaLower').val(),
            deaUp: $('#deaUp').val(),
            deaTarget: $('#deaTarget').val(),
            deaSamping: $('#deaSamping').val(),
            deaBugNum: $('#deaBugNum').val(),
            deaTotal: $('#deaTotal').val(),
            deaSingle: $('#deaSingle').val(),
            deaGroup: $('#deaGroup').val(),
            deaDecimal: $('#deaDecimal').val(),
            deaMeasure: $('#deaMeasure').val(),
            deaObject: $('#deaObject').val(),
            deaRealUp: $('#deaRealUp').val(),
            deaRealLower: $('#deaRealLower').val(),
            deaMethodCode: $('#deaMethodCode').val(),
            deaMethodText: $('#deaMethodText').val(),
            deaFactory: $('#deaFactory').val(),
            deaVersion: $('#deaVersion').val(),
            deaProcedureCode: $('#deaProcedureCode').val(),
            deaProcedureDetail: $('#deaProcedureDetail').val(),
            deaUnit: $('#deaUnit').val(),
            deaBasisNum: $('#deaBasisNum').val(),
            deaSamplingSize: $('#deaSamplingSize').val(),
            deaRuleTag: $('#deaRuleTag').val(),
            deaClientBatch: $('#deaClientBatch').val(),
            deaSelectFactory: $('#deaSelectFactory').val(),
            deaCode: $('#deaCode').val(),
            createTime: $('#createTime').val(),
            createName: $('#createName').val(),
            createId: $('#createId').val(),
            updateId: $('#updateId').val(),
            updateName: $('#updateName').val(),
            updateTime: $('#updateTime').val(),
            delFlag: $('#delFlag').val(),
            remark: $('#remark').val(),
            resultCode: $('#deaResultCode').val(),
            resultText: $('#deaResultText').val(),
            useDecisionCode: $('#deaUseCode').val(),
            useDecisionText: $('#deaUseText').val(),
            useDecisionGroup: $('#deaUserDecisionGroupCode').val(),
            flawCode: $('#deaBugTypeTemp').val(),
            flawText: $('#deaBugTypeText').val(),
            flawGroup: $('#deaBugTypeCodeGroupTemp').val(),
            flawGroupText: $('#deaBugTypeCodeGroupText').val(),
            assessCode: $('#dreaAssessTypeCode').val(),
            assessText: $('#dreaAssessTypeText').val(),
            // code:$('#code').val(),
            //   codeText:$('#codeText').val(),
            flawAddressCode: $('#deaBugAddressCode').val(),
            flawAddressText: $('#deaBugAddressText').val(),
            flawAddressGroup: $('#deaBugAddressCodeGroupTemp').val(),
            // deaProcessNum:$('#deaProcessNum').val(),
            flawAddressGroupText: $('#deaBugAddressCodeGroupText').val(),
            flawClassCode: $('#deaBugClassCode').val(),
            flawClassText: $('#deaBugClassText').val(),
            validVariableAvg: $('#validVariableAvg').val(),
            checkDescr: $('#checkDescr').val(),
            inspected: $('#inspected').val(),
            disqualification: $('#disqualification').val(),
            flawNum: $('#flawNum').val(),
            status: status
        }
        partsDetailModels.push(partDeatil)
        processes.push(process)
        $.showLoading();
        $.ajax({
            headers: {
                token: localStorage.getItem("token")
            },
            type: "post",
            url: 'api/qm/parts/save',
            dataType: 'json',
            contentType: 'application/json',
            data: JSON.stringify(part),
            success: function (data) {
                $.hideLoading();
                $.toast(data.msg, 1000, function () {
                    window.location.href = "qm/partItems?procId=" + partDeatil.procId + "&parId=" + partDeatil.parId;
                });
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(errorThrown);
            }
        })
    }
</script>
</html>
